package com.example.cart_system.controller;

import com.example.cart_system.pojo.GoodsInfo;
import com.example.cart_system.pojo.Order;
import com.example.cart_system.pojo.Result;
import com.example.cart_system.pojo.Usr;
import com.example.cart_system.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;
    @PostMapping("/orderlist")
    public Result<List<Order>> getOrderList(@RequestBody Usr usr) {
        List<Order> orderlist = orderService.getOrderList(usr);
        return new Result<List<Order>>().success(orderlist);
    }
}
